<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title></title>
		<link rel="stylesheet" href="css/base.css" />
		<link rel="stylesheet" href="css/forum.css" />
	</head>

	<body>
		<header>
			<div class="tophead">
				<div class="logo">
					<a href="#">世说新语</a>
				</div>
				<div id="mnav">
					<h2><span class="navicon"></span></h2>
					<ul>
						<li>
							<a href="#">网站首页</a>
						</li>
						<li>
							<a href="thrift_shop.html">二手商城</a>
						</li>
						<li>
							<a href="forum.html">论坛</a>
						</li>
						<li>
							<a href="endless_study.html">学无止境</a>
						</li>
						<li>
							<a href="#">注册</a>
						</li>
						<li>
							<a href="#">登录</a>
						</li>
					</ul>
				</div>
				<nav class="topnav" id="topnav">
					<ul>
						<li class="topnav_li user_function_li">
							<a class="topnav_a " href="#">
								<img src="img/a2.jpg" class="user_img" />
							</a>
							<div class="user_function_div">
								<div class="user_function_img_parent">
									<img src="img/a2.jpg" class="user_img" />
									<h3 class="user_name">行船全靠浪</h3>
								</div>
								<div>
									<ul class="user_function_ul">
										<li>
											<a href="#">个人中心</a>
										</li>
										<li>
											<a href="#">文章管理</a>
										</li>
										<li>
											<a href="#">贴文管理</a>
										</li>
										<li>
											<a href="#">商城管理</a>
										</li>
									</ul>
								</div>
								<a class="user_logout" href="#">安全退出</a>
							</div>
						</li>
						<li class="topnav_li">
							<a class="topnav_a" href="#">注册</a>
						</li>
						<li class="topnav_li">
							<a class="topnav_a" href="endless_study.html">学无止境</a>
						</li>
						<li class="topnav_li">
							<a class="topnav_a" href="forum.html">论坛</a>
						</li>
						<li class="topnav_li">
							<a class="topnav_a" href="thrift_shop.html">二手商城</a>
						</li>

						<li class="topnav_li">
							<a class="topnav_a" href="#">网站首页</a>
						</li>

					</ul>
				</nav>
			</div>
		</header>
		<section>
			<div class="row">
				<div class="forum_left">
					<div class="forum_search_parent">
						<label>热帖搜索:<input type="text" placeholder="请输入您要是搜索的帖子"  name="forum_search" class="forum_search" />  </label>
					</div>
					<div class="forum_parent">
						<div class="post_forum_parent">
							最新帖子
							<a href="forum_edit.html" class="post_forum_button">发表新帖子</a>
						</div>
						<ul class="forum_ul">
							
							
						</ul>
						<div class="pagelist">
							<a href="#" class="previous_page">&lt;</a>
							<a href="#">1</a>
							<a href="#">2</a>
							<a href="#">3</a>
							<a href="#">4</a>
							<a href="#">5</a>
							<a href="#" class="next_page">&gt;</a>
							<a href="#" class="last_page">末页&raquo;</a>
						</div>
					</div>
				</div>
				<div class="forum_right">
					<div class="forum_sign_parent">
						<span class="forum_sign-logo">签到</span>
						<p class="forum_sign_p">
							<span class="forum_sign_num">20003</span>
							<span><a href="#" class="forum_sign_rank">签到排名</a></span>
						</p>
					</div>
					<div class="forum_authority_parent">
						<h4>官方推送</h4>
						<div class="forum_authority_div">
							<img src="img/a2.jpg" class="forum_authority_img" />
							<p class="forum_authority_title">你们暑假是怎么过的？</p>
						</div>
						<div class="forum_authority_div">
							<img src="img/b05.jpg" class="forum_authority_img" />
							<p class="forum_authority_title">你们每个月生活费有多少呢？</p>
						</div>
					</div>
					<div class="forum_authority_parent">
						<h4>官方微信</h4>
						<img src="img/b07.jpg" class="forum_authority_core" />
						<p class="forum_authority_title">仲恺校园官方二维码</p>
					</div>
					<div class="cloud">
						<h2 class="hometitle">标签云</h2>
						<div>
							<a href="#">陌上花开</a>
							<a href="#">校园生活</a>
							<a href="#">梦想绽放</a>
							<a href="#">热情</a>
							<a href="#">青春</a>
							<a href="#">温暖</a>
							<a href="#">阳光</a>
							<a href="#">朝气</a>
							<a href="#">坚持</a>
							<a href="#">荣耀</a>
							<a href="#">生活</a>
							<a href="#">人生</a>
						</div>
					</div>
				</div>
			</div>
		</section>
		<footer>
			<p>Design by
				<a href="/">琪哥</a>
				<a href="/">初相遇 若重逢</a>
			</p>
		</footer>
		<script type="text/javascript" src="js/jquery.min.js" ></script>
		<script type="text/javascript" src="js/base.js" ></script>
		<script type="text/javascript">
			$(function(){
				function findAllForums(currentPage,count){
					$.post(
					"http://localhost:8080/campus/forum/findAllForums.do",
					{"currentPage":currentPage,
						"count":count,
						"hot_dot":$(".forum_search").val()
					},
					function(data){
					//遍历所有帖子
						$(data.forums).each(function(i,n){
							$(".forum_ul").append("<li class='forum_li'>"+
								"<img class='forum_post_img' src='img/a2.jpg' />"+
							   "<div class='forum_post_div'>"+
									"<h4><a class='forum_post_title' href='#'>"+n.forum_title+"</a></h4>"+
									"<p>"+
										"<a href='#' class='forum_post_author' value="+n.user_id+" ></a>"+
										"<span class='forum_post_news'>2300</span>"+
										"<span class='forum_post_view'>8333</span>"+
										"<span class='forum_post_time'>2018-16-12</span>"+
									"</p>"+
								"</div>"+
							"</li>");
							$(".forum_ul .forum_post_title").attr("href","forum_details.html?forum_id="+n.forum_id);
							$(data.users).each(function(i2,n2){
								var user_id=$(".forum_ul .forum_post_author").eq(i).attr("value");
								if(n2.user_id==user_id){
									$(".forum_ul .forum_post_author").eq(i).html(n2.username);
								};
							});
						});
					},
					"json"
				);
				}
				findAllForums(1,4);
			
			});
		</script>
		
	</body>

</html>